from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status

from users.models import CustomUser
from users.serializers import UserSerializer


class ArtistAcquisitionView(APIView):
    """
    获取艺术家的列表
    """

    def get(self, request):
        artists = CustomUser.objects.filter(role=0)
        serializer = UserSerializer(instance=artists, many=True)
        return Response(
            data={
                'result': serializer.data
            }, status=status.HTTP_200_OK)
